
#ifndef wu_STOPMOTION_MANAGER_H
#define wu_STOPMOTION_MANAGER_H

#pragma once
#include "wuStopMotion.h"
#include "wuBaseManager.h"
#include "wuSkin.h"
#include "wuInvisible.h"
#include "ofxXmlSettings.h"

class wuStopMotionManager : public wuInvisible
{
    public:
        wuStopMotionManager();
        ~wuStopMotionManager();

	    void setup(string _filename, int _vw, int _vh);
		bool action(ofImage *currImg, ofImage *bgImg, int action, int x_offset);
		void update();
		void addBitxo(ofImage *_skin, ofRectangle rect, vector <ofPoint> * _pts);
//        void addInvisibleBitxo(ofImage * _img, ofRectangle _rect);
        void draw(bool pinta_bg=false, int offX=0);
        void drawSelected(bool pinta_bg=false, int offX=0);
        void clear(void);
        void addFrame(ofImage * _img, ofRectangle _rect);
        void deleteFrame();
        void save();
        void load();
        void play();
        void setReverse(bool _rev);
        void setFreeze_end(bool _bfreeze);
        void setLoop(bool _bloop);
        void clear_actives();

 		vector<wuStopMotion> stopMotions;
		vector<wuSkin> skins;

        ofRectangle rect_sum;
        int vskin_count;
		string fileName;
		ofxXmlSettings XML;
		int framePtr, counter;
		bool bTest;
		bool bReverse;
		bool bLoop;
		bool bFreeze;
};
#endif

